/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * AgregarResolucionView.java
 *
 * Created on 25-may-2012, 6:50:45
 */
package educar.abmResolucion;

import java.awt.event.ActionListener;
import javax.swing.JButton;

/**
 *
 * @author Flubber
 */
public class AgregarResolucionView extends javax.swing.JDialog {

// <editor-fold defaultstate="collapsed" desc="Constructor">
    /** Creates new form AgregarResolucionView */
    public AgregarResolucionView() {
        initComponents();
    }
// </editor-fold>
    
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jlTitulo = new javax.swing.JLabel();
        jlNroAlumno = new javax.swing.JLabel();
        jlCodActividad = new javax.swing.JLabel();
        jlSolucion = new javax.swing.JLabel();
        jtfNroAlumno = new javax.swing.JTextField();
        jtfCodActividad = new javax.swing.JTextField();
        jbAceptar = new javax.swing.JButton();
        jbCancelar = new javax.swing.JButton();
        jScrollPane1 = new javax.swing.JScrollPane();
        jtaSolucion = new javax.swing.JTextArea();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);

        jlTitulo.setFont(new java.awt.Font("Tahoma", 1, 14));
        jlTitulo.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jlTitulo.setText("Agregar una Resolucion");

        jlNroAlumno.setFont(new java.awt.Font("Tahoma", 1, 12));
        jlNroAlumno.setText("Nro del Alumno");

        jlCodActividad.setFont(new java.awt.Font("Tahoma", 1, 12));
        jlCodActividad.setText("Codigo de la Actividad");

        jlSolucion.setFont(new java.awt.Font("Tahoma", 1, 12));
        jlSolucion.setText("Solucion");

        jbAceptar.setText("Aceptar");

        jbCancelar.setText("Cancelar");

        jtaSolucion.setColumns(20);
        jtaSolucion.setRows(5);
        jScrollPane1.setViewportView(jtaSolucion);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jScrollPane1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 426, Short.MAX_VALUE)
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(jbAceptar, javax.swing.GroupLayout.PREFERRED_SIZE, 91, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(18, 18, 18)
                        .addComponent(jbCancelar, javax.swing.GroupLayout.PREFERRED_SIZE, 86, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addComponent(jlTitulo, javax.swing.GroupLayout.DEFAULT_SIZE, 426, Short.MAX_VALUE)
                    .addComponent(jlSolucion)
                    .addGroup(layout.createSequentialGroup()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(jlNroAlumno, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(jlCodActividad, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                        .addGap(18, 18, 18)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jtfNroAlumno, javax.swing.GroupLayout.DEFAULT_SIZE, 271, Short.MAX_VALUE)
                            .addComponent(jtfCodActividad, javax.swing.GroupLayout.DEFAULT_SIZE, 271, Short.MAX_VALUE))))
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jlTitulo, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jlNroAlumno)
                    .addComponent(jtfNroAlumno, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jlCodActividad)
                    .addComponent(jtfCodActividad, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addComponent(jlSolucion)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 154, Short.MAX_VALUE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jbAceptar, javax.swing.GroupLayout.PREFERRED_SIZE, 34, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jbCancelar, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap())
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

// <editor-fold defaultstate="collapsed" desc="Declaracion de variables">      
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JButton jbAceptar;
    private javax.swing.JButton jbCancelar;
    private javax.swing.JLabel jlCodActividad;
    private javax.swing.JLabel jlNroAlumno;
    private javax.swing.JLabel jlSolucion;
    private javax.swing.JLabel jlTitulo;
    private javax.swing.JTextArea jtaSolucion;
    private javax.swing.JTextField jtfCodActividad;
    private javax.swing.JTextField jtfNroAlumno;
    // End of variables declaration//GEN-END:variables
// </editor-fold>

    public void setTitulo(String Titulo) {
        this.jlTitulo.setText(Titulo);
    }
    
    public JButton getJbAceptar() {
        return jbAceptar;
    }

    public JButton getJbCancelar() {
        return jbCancelar;
    }

    public String getSolucion() {
        return jtaSolucion.getText();
    }

    public void setSolucion(String Solucion) {
        this.jtaSolucion.setText(Solucion);
    }

    public String getCodActividad() {
        return jtfCodActividad.getText();
    }

    public void setCodActividad(String CodActividad) {
        this.jtfCodActividad.setText(CodActividad);
    }

    public String getNroAlumno() {
        return jtfNroAlumno.getText();
    }

    public void setNroAlumno(String NroAlumno) {
        this.jtfNroAlumno.setText(NroAlumno);
    }

    /**
     * Asigna un Listener a los Botones
     * @param listener
     */    
    public void setActionListener(ActionListener listener) {
        jbAceptar.addActionListener(listener);
        jbCancelar.addActionListener(listener);
    }
}
